// ELabels3-Extension.js

		ELabelEx.prototype = new ELabel();
		ELabelEx.prototype.parent = ELabel.prototype;
		function ELabelEx(map, point, html, classname, pixelOffset, percentOpacity, overlap){
			 ELabel.call(this,map, point, html, classname, pixelOffset, percentOpacity, overlap);
		}
		ELabelEx.prototype.draw = function(force)
		{
		        this.parent.draw.call(this,force);
		        this.infoBoxClearance=new google.maps.Size(10, 10);
		        this.alignBottom=true;

		        var map;
		        var xOffset = 0, yOffset = 0;
		          map = this.map;
		          if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama
		            if (!map.getBounds().contains(this.point)) {
		            // Marker not in visible area of map, so set center
		            // of map to the marker position first.
		              map.setCenter(this.point);
		            }

		            var mapDiv = map.getDiv();
		            var mapWidth = mapDiv.offsetWidth;
		            var mapHeight = mapDiv.offsetHeight;
		            var iwOffsetX = this.pixelOffset.width;
		            var iwOffsetY = this.pixelOffset.height;
		            var iwWidth = this.div_.offsetWidth;
		            var iwHeight = this.div_.offsetHeight;
		            var padX = this.infoBoxClearance.width;
		            var padY = this.infoBoxClearance.height;
		            var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.point);

		            if (pixPosition.x < (-iwOffsetX + padX)) {
		              xOffset = pixPosition.x + iwOffsetX - padX;
		            } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {
		              xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
		            }
		            if (this.alignBottom) {
		              if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {
		                yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
		              } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {
		                yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
		              }
		            } else {
		              if (pixPosition.y < (-iwOffsetY + padY)) {
		                yOffset = pixPosition.y + iwOffsetY - padY;
		              } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {
		                yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
		              }
		            }

		            if (!(xOffset === 0 && yOffset === 0)) {

		              // Move the map to the shifted center.
		              var c = map.getCenter();
		              map.panBy(xOffset, yOffset);
		            }
		          }
		}
